<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>员工信息</title>
    <link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
    <script src="${pageContext.request.contextPath}/js/jquery-3.5.1.js"></script>

</head>
<body>
<div class="container">

    <div class="row clearfix">
        <div class="col-md-12 column">
            <div class="page-header">
                <h1>
                    <small>员工列表 —— 显示所有员工</small>
                </h1>
            </div>
        </div>
    </div>

    <div class="row">
        <div class="col-md-4 cloumn">
            <a href="../add.jsp" class="btn btn-primary" >新增员工</a>
        </div>
        <div class="col-md-4 cloumn"></div>
        <div class="col-md-4 cloumn">
            <form class="from-inline" action="" method="post" style="float: right">
                <input type="text" name="queryBook" class="from-control" placeholder="请输入查询"
                       required>
                <input type="submit" value="查询" class="btn btn-primary">
            </form>
        </div>
    </div>


    <div class="row clearfix">
        <div class="col-md-12 column">
            <table class="table table-hover table-striped">
                <thead>
                <tr>
                    <th>员工号</th>
                    <th>员工名</th>
                    <th>部门名</th>
                    <th>职务</th>
                    <th>入职时间</th>
                    <th>联系方式</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                <c:forEach var="employee" items="${list}">
                    <tr>
                        <td>${employee.empId}</td>
                        <td>${employee.empName}</td>
                        <td>${employee.dept.deptName}</td>
                        <td>${employee.jobName}</td>
                        <td>${employee.joinDate}</td>
                        <td>${employee.telephone}</td>
                        <td>
                            <a href="${pageContext.request.contextPath}">修改</a>
                            &nbsp;｜&nbsp;
                            <a href="${pageContext.request.contextPath}">删除</a>
                        </td>
                    </tr>
                </c:forEach>
                </tbody>

            </table>
        </div>
    </div>
</div>
</body>

</html>
